package com.xinqi.modules.exam.common.assistant.enums;

import lombok.Getter;

/**
 * 消息子类型， 0-发布；1-催交；2-打回；3-成绩；4-提醒；5-开始；
 * 对应 AssistantTypeEnum
 *
 * @author linkai
 * @date 2023/7/15
 */
public enum MessageSubTypeEnum {
    发布(0, "发布"),
    催交(1, "催交"),
    打回(2, "打回"),
    成绩(3, "成绩"),
    提醒(4, "提醒"),
    开始(5, "开始"),
    强制交卷(42, "强制交卷"),
    结束(43, "结束"),
    测评已被删除(44, "测评已被删除"),
    ;

    @Getter
    private final int code;
    @Getter
    private final String description;

    MessageSubTypeEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static MessageSubTypeEnum of(int code) {
        for (MessageSubTypeEnum value : MessageSubTypeEnum.values()) {
            if (value.getCode() == code) {
                return value;
            }
        }
        return null;
    }

}
